package Doudizhu;

import Util.Util;

import javax.swing.*;


public class Test extends JFrame {


    public Test() {
        Doudizhu doudizhu = new Doudizhu();
        doudizhu.init();
        doudizhu.xipai();
        doudizhu.faPai();
        this.setLayout(null);
        int y = 500;
        for (int i = 0; i < 17; i++) {
            ImageIcon image = Util2.Util.getImageIcon("/img/" + doudizhu.getPalyer1().get(i) + ".jpg");
            JButton btn1 = new JButton(image);
            btn1.setBounds(10, y, 105, 150);
            this.add(btn1);
            y -= 30;

        }
        int z = 500;
        for (int i = 0; i < 17; i++) {
            ImageIcon image = Util2.Util.getImageIcon("/img/" + doudizhu.getPalyer2().get(i) + ".jpg");
            JButton btn1 = new JButton(image);
            btn1.setBounds(665, z, 105, 150);
            this.add(btn1);
            z -= 30;
        }
        int b = 575;
        for (int i = 0; i < 17; i++) {
            ImageIcon image = Util2.Util.getImageIcon("/img/" + doudizhu.getPalyer2().get(i) + ".jpg");
            JButton btn1 = new JButton(image);
            btn1.setBounds(b, 650, 105, 150);
            this.add(btn1);
            b -= 30;
        }

        JButton btn1 = new JButton("叫地主");
        JButton btn2 = new JButton("抢地主");
        JButton btn3 = new JButton("明牌");
        btn1.setBounds(200, 450, 100, 20);
        btn2.setBounds(320, 450, 100, 20);
        btn3.setBounds(440, 450, 100, 20);
        this.add(btn1);
        this.add(btn2);
        this.add(btn3);


        //设置窗口大小
        this.setSize(850, 1000);


        //设置窗体的文字标题
        this.setTitle("测试窗口");
        //设置窗体居中
        this.setLocationRelativeTo(null);
        //设置窗口关闭时程序结束
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        //设置窗体可见
        this.setVisible(true);

    }


    public static void main(String[] args) {
        new Test();
    }
}
